<template>
  <div>
    <section class="c_bh">
      <div>
        <span>NO.
          {{prescribeInfo.ORDERCODE}}
        </span>
      </div>
    </section>

    <section class="c_nav_hospitalname">
      <div>
        <div>
          <span>{{hospitalName}}</span>
        </div>
        <div>
          <span>{{prescribeInfo.PRESCRIBETYPE=='1'?'中药':'西药'}}</span>
          <span>处方笺</span>
        </div>
      </div>

    </section>

    <!-- 患者信息 -->
    <section class="c_patient_info">
      <div>
        <!-- <div>
          <span>医疗证/医保卡号：<b>{{prescribeInfo.PATIENT_HEALTHCARD}}</b></span>
          <span><b>【{{prescribeInfo.PATIENT_HEALTHCARD==''?'自费':'医保'}}】</b></span>
        </div>-->

        <div>
          <span>姓名：<b>{{prescribeInfo.PATIENTNAME}}</b></span>
          <span>性别:<b>{{prescribeInfo.ACCSEX}}</b></span>
          <span>年龄:<b>{{prescribeInfo.PATNL}}</b></span>

        </div>

        <div>
          <span>科室：<b>{{prescribeInfo.SSKBMC}}</b></span>
          <span>日期:<b>{{prescribeInfo.ORDERTIME}}</b></span>
        </div>
        <div>诊断：{{this.prescribeInfo.DIAGNOSIS_DETAIL}}</div>
      </div>
    </section>

    <!-- 开药选项 -->
    <section v-show="true" class="zhongyao">
      <section class="zhongyao_con">
        <div class="zhongyao_c_title">
          <p>Rp：</p>
        </div>
      </section>
    </section>

    <div class="medicList">
      <div class="medic_o">
        <span v-if="dragList1.length > 0" class="medic_l">
          <ul>
            <li v-for="(item,index) in dragList1" :key="item.id" style="width: 90%;">
              <span>{{index+1}}</span><span>{{item.XMMC}}</span>
              <span>{{item.SL}} * {{item.DJ}} = {{item.FSJE}}元</span>
              <!-- <span>{{item.SL}}{{item.DJ}}</span> -->
            </li>
          </ul>
        </span>
        <span v-else>
          <span @click="getPreDetail()">获取详细信息</span>
        </span>
        <p class="medic_p">
          <span>总共 {{this.prescribeInfo.QTY}} 剂&nbsp;<i>（每剂 {{ dragList1.length }} 味药）</i></span>

        </p>
        <p class="medic_p">医嘱：{{this.prescribeInfo.ADVICE}}</p>

      </div>
      <div class="medic_c">
        <div>
          <span>
            医师：<b>{{prescribeInfo.DOCNAME}}</b>
          </span>
          <span>
            处方总金额（元）：<b>{{prescribeInfo.JE}}</b>
          </span>
        </div>

      </div>
      <div style="text-align: center;">
        <mt-button type="default" @click="closePreDetails" style="width:30%">关    闭</mt-button>
      </div>
    </div>
  </div>

</template>
<script>

export default {
  data() {
    return {

      fujia_options: [{ label: '代煎费(10元／每剂)', value: 10, disabled: true }, { label: '快递费(12元／每次)', value: 12, disabled: true }],

      // buttStyle: 'default', // 输入前：default, 输入后：primary
      fujia_list: [],
      ybgg: '药品规格为饮片',

      dragList1: [

      ],
<<<<<<< HEAD
      hospitalName: sessionStorage.getItem('hosName'),
      ts: this.newStore(),

=======
      hospitalName: '',
      userinfo: {},
>>>>>>> 4b0d969a5166bde7cb882eb0a25f226d8fedeecf
    };
  },
  props: {
    prescribeInfo: {
      type: Object,
    },
  },

  components: {
  },
  watch: {
    prescribeInfo(val, oldVal) {
      console.log('===================== presribeDatial ===================');
      console.log(JSON.stringify(val));
      // this.dragList1 = val.DURGLIST.split(',');
      // this.fujia_list = JSON.parse(val.PRESCRIBEEXPLAIN);
      // console.log(oldVal);
      // console.log('33333333333333333333');
    },
  },
  created() {
    this.userinfo = JSON.parse(localStorage.getItem(`userInfo.${config.LT}`));
    this.hospitalName = this.userinfo.hospital;
    this.$root.showfooter = false;
  },
  destroyed() {
    this.$root.showfooter = true;
  },
  mounted() {
  },
  methods: {
    closePreDetails() {
      this.dragList1 = [];
      this.$emit('closePreDetails');
    },
    getPreDetail() {
      const req = JSON.stringify({
        OTRequest: {
          VERSION: '1.0',
          TN: 'F27.APP.01.29',
          CLIENTID: 'YLAPP',
          RYBID: 'DOCTOR',
          TOKEN: `${sessionStorage.getItem('rybToken')}`,
          DATA: {
            chufangInfo: {
              pres_id: this.prescribeInfo.PRES_ID,
            },
          },
        },
      });

      this.spost(this.ts, '/doctor/AppMainServlet.ap', {
        '': req,
      }).then((ts) => {
        // 查询处方明细
        console.log(' ================= presribeDatial > prescribeInfo ================= ');
        console.log(JSON.stringify(ts.d.DATAOBJ));
        this.dragList1 = ts.d.DATAOBJ.DATA.DETAILBEAN;
      });
    },
  },
};
</script>
<style scoped>
* {
  margin: 0;
  padding: 0;
}
.mint-cell{
  height: 27px;
  line-height: 27px;
  min-height: 27px;
}
.mint-cell-wrapper {    /* 隐藏服务项目下边线 */
  background-image: none;
}
.mint-cell:last-child{  /* 隐藏医嘱下边线 */
  background-image: none;
}
.input_search1_1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #ccc;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 75%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.input_search2_1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 75%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.input_search1 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #ccc;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 40%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.input_search2 {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 40%;
  margin-top: 0.1rem;
  margin-right: 5%;
}
.select_c {
  width: 65%;
  padding: 2%;
  font-size: 0.9rem;
  outline: none;
  border-radius: 0.2rem;
  /* appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none; */
}
.select_c option {
  line-height: 20px;
  border: 0;
  padding: 1rem;
}
.select_c option:hover {
  background: #ebccd1;
}
.step2 {
  margin-top: 5%;
  border-radius: 0.2rem;
  height: 70%;
  width: 90%;
  /* margin-bottom: 76%; */
}
.zhongyao{
  border-top: .5px dashed #ccc;
  margin-top: .9rem;
}
label{
  margin-bottom: 0;
}
.c_patient_info {
  display: flex;
  justify-content: center;
  font-size: .9rem;
  letter-spacing: .05rem;
  background-color: #fff;
  padding: 0 .5rem;
  height: 3rem;
  color:#999;
}
.c_patient_info b {
  font-weight: normal;
  color: #000;
}
.c_patient_info div {
  width: 100%;
}
.c_patient_info div div{
  display: flex;
  flex-flow: row | nowrap;
  justify-content: space-between;
  width:100%;
}
.c_bh {
  color: #666;
  padding: .3rem;
}
.c_bh div span:first-child{
  z-index: 888;
  line-height: 1rem;
  vertical-align: middle;
}
.medicList{
  position: absolute;
  top: 25%;
  left: 0;
  width: 100%;
  max-height: 68%; /* 带好盖住后面的内容 */
  z-index: 888;
  overflow: auto;
  background: #fff;
  /* padding:.5rem; */
  font-size: .9rem;
  color: #333;
}
.medicList ul li{
  line-height: 2rem;
  padding-left: 1rem;
  display: inline-flex;
}
.cckb{
  text-align: center;
  color: #ccc;
}
.medic_o{
  height: 80%;
  overflow: auto;
  padding: .5rem;
}
.medic_o li span{
  margin-right: 1.5rem;
}
.medic_o p:first-child {
  text-align: center;
}
.medic_t{
  position: fixed;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  padding: .5rem;
}
.medic_t span{
  display: flex;
  justify-content: center;
  flex-direction: row;
  justify-content: center;
  width: 100%;
}
.medic_c{
  height: 10%;
  border-top: 1px dashed #ccc;
  /* border-bottom: 1px solid #fff; */
  padding: .5rem;
}
.medic_c div{
  display: flex;
  line-height: normal;
  flex-flow: row | nowrap;
  justify-content: space-between;
  align-items: stretch;
}
.medic_c div span{
  color: #999;
}
.medic_c div span b{
  color: #333;
}
.medic_p{
  position: relative;
  bottom: 0;
  font-weight: 500;
  border-bottom: 1px solid #fff;
}
.medic_p span{
  display: inline-block;
}
.mint-checkbox-label{
  font-size: 0.9rem
}
.s_input{
  width: 90%;
  height: 12rem;
  background: #f1f1f1;
  position: absolute;
  top: -400%;
  margin: 0 5%;
}
.s_input .s_text{
  border: none;
  width: 80%;
  font-family: "Microsoft Yahei";
  color: #333;
  outline: none;
  text-indent: 1rem;
  line-height: 2rem;
  margin-top: 10%;
  cursor: pointer;
}
.c_nav_hospitalname {
  letter-spacing: .05rem;
  display: flex;
  justify-content: center;
  background-color: #fff;
  padding: 0rem;
  height: 3rem;
  color:#333;
}
.c_nav_hospitalname div div {
  display: flex;
  flex-flow: column | nowrap;
  justify-content: center;
  align-items: center;
}
.c_nav_hospitalname div div:last-child {
  font-size: .9rem;
  display: inline-block;
}
.c_nav_hospitalname div div:last-child span{
  padding: 0 .3rem 0 .3rem;
}
.c_nav {
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  padding: 1rem;
  border-bottom: 1px solid #ebebeb;
  position: relative;
  height: 3rem;
}
.c_nav_active {
  color: #3190e8;
  border-bottom: 2px solid #3190e8;
}
@keyframes tipMove {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.8);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.fade-choose-enter-active,
.fade-choose-leave-active {
  transition: opacity 0.2s;
}
.fade-choose-leave,
.fade-choose-leave-active {
  display: none;
}
.fade-choose-enter,
.fade-choose-leave-active {
  opacity: 0;
}
.zhongyao_c_title p {
  font-family: "Microsoft Yahei";
  color: #666;
  margin-bottom: 0;
  padding: 0.4rem;
  font-size: .9rem;
}
.zhongyao_c_content {
  max-height: 22rem;
  overflow: auto;
  padding: 0.5rem;
  position: relative;
  font-size: .9rem;
  color: #333;
}
.zhongyao_c_content .m-slide .m-slide__del-red{
  background: #3190e8;
  border-radius: 0.2rem;
  width: 4rem;
  height: 1.4rem;
  border: none;
  margin-top: 0.1rem;
}
.zhongyao_c_content .m-slide .m-slide__top{
  height: 1.8rem;
}
.zhongyao_c_content ul li {
  list-style: none;
  font-size: 0.9rem;
  height: 2.5rem;
  width: 100%;
  overflow: hidden;
}
.zhongyao_y {
  font-family: "Microsoft Yahei";
  color: #333;
  float: left;
  width: 65%;
  overflow: auto;
}
.zhongyao_c {
  float: right;
  width: 35%;
  overflow: hidden;
  text-align: right;
}
.demo-item{
  width: 60%;
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap
}
.zhongyao_c i {
  padding: 0.2rem;
  font-size: 0.9rem;
}
.input_number {
  border: none;
  width: 20%;
  text-align: center;
  font-family: "Microsoft Yahei";
  color: #333;
  background: #f1f1f1;
  border-radius: 0.4rem;
}
.input_n {
  border: none;
  border-bottom: 2px solid #f1f1f1;
  width: 16%;
  font-family: "Microsoft Yahei";
  color: #333;
  outline: none;
  height: 2rem;
  margin: 0 0.1rem;
  text-align: center;
  float: right;
}
.buttonRemove {
  padding: 0 0.2rem;
  border: none;
  float: right;
  background: #3190e8;
  color: #fff;
  border-radius: 0.2rem;
  margin-right: 0.2rem;
}
.zhongyao_c_footer {
  position: fixed;
  bottom: 0;
  text-align: left;
  width: 100%;
  background: #fff;
  z-index: 188;
}
.zhongyao_c_footer p{
  margin-bottom: 0;
}
.input_name {
  text-indent: .5rem;
  border: none;
  width: 80%;
  text-align: left;
  font-family: "Microsoft Yahei";
  color: #333;
  outline: none;
  padding:0.5rem 0;
  margin-bottom: 0.2rem;
  font-size: .9rem;
  /* border-bottom: 2px solid #f1f1f1; */
}
.input_tip {
  width: 100%;
  font-family: "Microsoft Yahei";
  color: #333;
  text-indent: 0.5rem;
  line-height: 2rem;
  border:none;
  outline: none;
}
.input_tip:focus{
  background: #3190e84d;
}
.input_search_openpre {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 20%;
  margin-top: 0.1rem;
}
.input_search {
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  background: #3190e8;
  border: 1px solid #dcdfe6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  width: 100%;
  margin-top: 0.1rem;
}
.searchList {
  width: 100%;
  background: #fff;
  display: inline-block;
  overflow: auto;
  z-index: 100;
  height: 20rem;
  border-bottom: 1px solid #f1f1f1;
  text-indent: .5rem;
  padding-left: .3rem;
  padding-right: .3rem;
  border-radius: 10px;
  color: #000;
  -webkit-box-shadow: 0px -3px 10px #ccc;
  -moz-box-shadow: 0px -3px 10px #ccc;
  box-shadow: 0px -3px 10px #ccc;
  /*
  -webkit-transform: translate3d(5, -50%, 0);
  transform: translateY(0%); */
}
.searchList ul {
  margin-bottom: 0;
}
.searchList ul li {
  font-size: 0.9rem;
  height: 2rem;
  border-bottom: 1px solid #ccc;
  line-height: 2rem;
  text-align: left;
  width: 100%;
  overflow: hidden;
}
</style>
